﻿using System;

namespace FinMkts
{
    public class MarketDataListing
    {
        public virtual Guid MarketPlaceId { get; set; }

        public virtual Guid InstrumentId { get; set; }

        public virtual Guid MarketDataProviderId { get; set; }
        
        /// <summary>
        /// The market data provider
        /// </summary>
        public virtual MarketDataProvider MarketDataProvider { get; set; }

        /// <summary>
        /// The identifier used to get the price of this listed instrument
        /// </summary>
        public virtual string DataCode { get; set; }

        /// <summary>
        /// The market to view
        /// </summary>
        public virtual MarketListing MarketListing { get; set; }

        ///// <summary>
        ///// fees for viewing market data
        ///// </summary>
        //IEnumerable<IMarketDataFee> Fees { get; }

        /// <summary>
        /// The price of this market
        /// </summary>
        public virtual IObservable<MarketPrice> GetPrice()
        {
            return MarketDataProvider.GetPrice(DataCode);
        }
    }
}